<?php
/**
 * Logging messages.
 * @author Pishta
 */
class Log {
	
	const ERR_MESSAGE = "; Error: ";
	const ERR_CODE = "; Code: ";
	const ERR_FILE = "; In file: ";
	const ERR_LINE = "; At line: ";
	
	const INFO_MESSAGE = "; Info: ";
	
	final static function logError($ex) {
		$error = self::ERR_MESSAGE . $ex->getMessage();
		$error .= self::ERR_CODE . $ex->getCode();
		$error .= self::ERR_FILE . $ex->getFile();
		$error .= self::ERR_LINE . $ex->getLine();
		error_log($error);
	}

	final static function logInfo($message) {
		$text = self::INFO_MESSAGE . $message;
		syslog(LOG_INFO, $text);
	}
}